const express = require('express');
const joinOrCancle = express.Router();
const MeetingList = require('../model/list')
//参加会议
joinOrCancle.post('/join', (req, res) => {
  MeetingList.updateOne({ id: req.body.id }, { $push: { list: req.body.username } }).then(result => res.send({
    code: 200, data: result
  }))
})
//取消参加会议
joinOrCancle.post('/exit', (req, res) => {
  MeetingList.updateOne({ id: req.body.id }, { $pull: { list: req.body.username } }).then(result => res.send({
    code: 200, data: result
  }))
})
module.exports = joinOrCancle;